<?php
/**
 *  view: payment home view
 *  File: payment/home.php 
 * 
 */
?>


 <div id="f_main">
 	<div class="f_container">
      <form id="packet-form">
     <!---------BUY-BOX--------->
    	<h3><?php echo lang('bay_coins'); ?></h3>
        <div class="buy-box">
        	<p class="buy-paket-name"><?php echo lang('packet'); ?> S</p>
            <p class="buy-coin"><?php echo lang('coins'); ?><br /><span>175</span></p>
            <p class="buy-price"><?php echo lang('price'); ?><br /><span>€ 34.99</span></p>            
            <label for="ps" class="order" alt="ps"><?php echo lang('order'); ?> <br/>
              <input type="radio" name="package" value="packet_s" id="ps"/></label>
        </div><!--End buy-box-->
        <div class="buy-box">
        	<p class="buy-paket-name"><?php echo lang('packet'); ?> M</p>
            <p class="buy-coin"><?php echo lang('coins'); ?><br /><span>475</span></p>
            <p class="buy-price"><?php echo lang('price'); ?><br /><span>€ 89.99</span></p>           
            <label for="pm" class="order" alt="pm"><?php echo lang('order'); ?><br/>
            <input type="radio" name="package" value="packet_m"  id="pm" checked="checked" /></label>
        </div><!--End buy-box-->
        <div class="buy-box">
        	<p class="buy-paket-name"><?php echo lang('packet'); ?> L</p>
            <p class="buy-coin"><?php echo lang('coins'); ?><br /><span>850</span></p>
            <p class="buy-price"><?php echo lang('price'); ?><br /><span>€ 149.99</span></p>            
            <label for="pl" class="order" alt='pl'><?php echo lang('order'); ?><br/>
            <input type="radio" name="package" value="packet_l"  id="pl" /></label>
        </div><!--End buy-box-->
        <div class="buy-box">
        	<p class="buy-paket-name"><?php echo lang('packet'); ?> XL</p>
            <p class="buy-coin"><?php echo lang('coins'); ?><br /><span>1450</span></p>
            <p class="buy-price"><?php echo lang('price'); ?><br /><span>€ 249.99</span></p>
            <label for="pxl" class="order"  alt="pxl"><?php echo lang('order'); ?><br/>
            <input type="radio" name="package" value="packet_xl"  id="pxl" /></label>
        </div><!--End buy-box-->
        <div class="buy-box">
        	<p class="buy-paket-name"><?php echo lang('packet'); ?> XXL</p>
            <p class="buy-coin"><?php echo lang('coins'); ?><br /><span>3000</span></p>
            <p class="buy-price"><?php echo lang('price'); ?><br /><span>€ 499.99</span></p>
            <label for="pxxl" class="order" alt="pxxl"><?php echo lang('order'); ?><br/>
            <input type="radio" name="package" value="packet_xxl" id="pxxl" /></label>
        </div><!--End buy-box-->       
        
   <div class="clr"></div>
      <br/><br/>
      <!-- -------END BUY-BOX--------->
      </form>
      <?php 
      /**
       *  PAY PAL PAYMENT FORM
       */      
      ?>
      <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" name="paypal_form" id="paypal_form" method="post">
        
        <input type="hidden" name="cmd" value="_xclick" />
        <input type="hidden" name="business" value="tlocalhost-facilitator@gmail.com" />
        <input type="hidden" name="item_name" id="item_name" value="" />
        <input type="hidden" name="item_number"  id="item_number" value="" />
        <input type="hidden" name="amount" id="item_amount" value="1.03" />
        <!--<input type="hidden" name="tax" value="1">-->
        <input type="hidden" name="quantity" value="1">
        <input type="hidden" name="no_note" value="1">
        <input type="hidden" name="currency_code" value="EUR">
        <!-- Enable override of payer's stored PayPal address -->
        <input type="hidden" name="address_override" value="1">
        <input type="hidden" name="notify_url" value="<?php echo base_url(); ?>pay_pal/ipnlistener.htm">
        <input type="hidden" name="return" value="<?php echo base_url(); ?>profile.htm">
        <input type="hidden" name="cancel_return" value="<?php echo base_url(); ?>payment.htm">
        
        <a href="javascript:paypal_submit();" ><img src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" /></a>
      </form>
      
      <br/><br/>
   <div class="clr"></div>
   
   
  	
   
    </div><!--end f_container-->
 </div><!--end f_main-->
 
 <script type="text/javascript">
 
 function paypal_submit()
 {     
    var prices = new Array();
    prices['packet_s'] = <?php echo $this->config->item('packet_s'); ?>;
    prices['packet_m'] = <?php echo $this->config->item('packet_m'); ?>;
    prices['packet_l'] = <?php echo $this->config->item('packet_l'); ?>;
    prices['packet_xl'] = <?php echo $this->config->item('packet_xl'); ?>;
    prices['packet_xxl'] = <?php echo $this->config->item('packet_xxl'); ?>;
//    var packet_name = new Array();
//    packet_name['packet_s'] = '<?php echo $this->config->item('packet_s_name')." / ".$this->config->item('packet_s_coins').' '.lang('coins'); ?>';
//    packet_name['packet_m'] = '<?php echo $this->config->item('packet_m_name')." / ".$this->config->item('packet_m_coins').' '.lang('coins'); ?>';
//    packet_name['packet_l'] = '<?php echo $this->config->item('packet_l_name')." / ".$this->config->item('packet_l_coins').' '.lang('coins'); ?>';
//    packet_name['packet_xl'] = '<?php echo $this->config->item('packet_xl_name')." / ".$this->config->item('packet_xl_coins').' '.lang('coins'); ?>';
//    packet_name['packet_xxl'] = '<?php echo $this->config->item('packet_xxl_name')." / ".$this->config->item('packet_xxl_coins').' '.lang('coins'); ?>';
    
    
  
   var packet = $("#packet-form input[type='radio']:checked").val();  

   //$("#item_name").val(packet_name[packet]);
   $("#item_name").val(packet);
   $("#item_amount").val(prices[packet]);
   //$("#item_number").val(packet);
   $("#item_number").val(<?php echo $this->session->userdata('user_id'); ?>);
   
   $("#paypal_form").submit();
 }
 
 </script>